home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / share / snmp / mib2c-data / generic-table-indexes-to-oid.m2i < prev    next >
Text File  |  2008-09-22  |  2KB  |  54 lines

  1. #############################################################  -*- c -*-
  2. ## generic include for XXX. Do not use directly.
  3. ##
  4. ## $Id: generic-table-indexes-to-oid.m2i 12019 2005-03-22 22:27:57Z rstory $
  5. ########################################################################
  6. @if $m2c_mark_boundary == 1@
  7. /** START code generated by $RCSfile$ $Revision: 12019 $ */
  8. @end@
  9. ########################################################################
  10. ##
  11. /**
  12.  * @internal
  13.  * convert the index component stored in the context to an oid
  14.  */
  15. int
  16. ${context}_index_to_oid(netsnmp_index *oid_idx,
  17.                          ${context}_mib_index *mib_idx)
  18. {
  19. @include generic-table-indexes-varbind-setup.m2i@
  20.  
  21.     DEBUGMSGTL(("verbose:${context}:${context}_index_to_oid","called\n"));
  22.  
  23. @    foreach $node index@
  24. @        include m2c_setup_node.m2i@
  25.         /* $m2c_node_summary */
  26. @        if $m2c_node_needlength == 1@
  27.     snmp_set_var_value(&var_$node, (u_char*)&mib_idx->$node,
  28.                        mib_idx->${node}_len * sizeof(mib_idx->${node}[0]));
  29. @        else@
  30.     snmp_set_var_value(&var_$node, (u_char*)&mib_idx->$node,
  31.                        sizeof(mib_idx->$node));
  32. @        end@
  33.  
  34. @    end@ # for each column
  35.  
  36.     err = build_oid_noalloc(oid_idx->oids, oid_idx->len, &oid_idx->len,
  37.                            NULL, 0, &var_$m2c_dii_first);
  38.     if(err)
  39.         snmp_log(LOG_ERR,"error %d converting index to oid\n", err);
  40.  
  41.     /*
  42.      * parsing may have allocated memory. free it.
  43.      */
  44.     snmp_reset_var_buffers( &var_$m2c_dii_first );
  45.  
  46.     return err;
  47. } /* ${context}_index_to_oid */
  48.  
  49. ##
  50. ########################################################################
  51. @if $m2c_mark_boundary == 1@
  52. /** END code generated by $RCSfile$ $Revision: 12019 $ */
  53. @end@
  54.